import request from '@/axios'
import { OrgTypeType } from './types'

//分页获取组织类型
export const pageApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/orgtype/page', data })
}

//新增组织类型
export const addApi = (data) => {
  return request.post({ url: '/rbac-server/rbac/orgtype/add', data })
}
//获取组织类型
export const getApi = (params) => {
  return request.get({ url: '/rbac-server/rbac/orgtype/get', params })
}
//删除组织类型
export const delApi = (id) => {
  return request.delete({ url: '/rbac-server/rbac/orgtype/delete', params: { id } })
}
//修改组织类型
export const updateApi = (data) => {
  return request.put({ url: '/rbac-server/rbac/orgtype/update', data })
}

//获取启用组织类型
export const listAllApi = (data): Promise<IResponse<OrgTypeType[]>> => {
  return request.post({ url: '/rbac-server/rbac/orgtype/listAll', data })
}

//排序
export const sortApi = (params) => {
  return request.put({ url: '/rbac-server/rbac/orgtype/sort', params })
}
